package com.sinopec.basemodule.constants;

import android.os.Build;

import me.iso88591.uhfg.common.ConstKt;

/**
 * @author lwj
 * @ClassName: DeviceEnum
 * @Description: 获取设备信息 区分手机设备/手持设备
 * @date 2019/8/14 15:15
 */
public enum DeviceEnum {

    /**
     * 1, "手机设备"
     */
    PHONE(1, "手机设备"),
    /**
     * 2, "common手持设备"
     */
    COMMON(2, "common手持设备"),
    /**
     * 3, "汉德霍尔普通K71手持设备"
     */
    K71(3,"k71"),
    /**
     * 4, "优博讯DT51手持设备"
     */
    DT51(4,"DT51手持设备"),
    /**
     * 汉德霍尔防爆机
     */
    KJD(5,"kjd");

    private int id;
    private String value;

    DeviceEnum(int id, String value) {
        this.id = id;
        this.value = value;
    }

    public static DeviceEnum deviceType() {
        switch(Build.MODEL){
            case "common" :
                return COMMON;
            case ConstKt.k71v1_64_bsp :
                return K71;
            case "DT51" :
                return DT51;
            case "KJD3.7(A)" :
                return KJD;
            //你可以有任意数量的case语句
            default :
                return PHONE;
        }
    }

    //是否是手持设备
    public static boolean isHandDevice(){
        return DeviceEnum.COMMON == DeviceEnum.deviceType() || DeviceEnum.K71 == DeviceEnum.deviceType() || DeviceEnum.DT51 == DeviceEnum.deviceType() || DeviceEnum.KJD == DeviceEnum.deviceType();
    }
}